package com.evan.aiu.controller;

import com.evan.aiu.ai.ApplyAi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api("AI接口")
public class BaiDuApiController {
    @Autowired
    ApplyAi applyAi;

    @CrossOrigin
    @RequestMapping("/api/baidu/{filepath}")
    @ApiOperation(value = "动物种类识别", notes = "调用百度接口识别动物种类")
    public String searchResult(@PathVariable("filepath") String filepath) {
        String path = filepath.replace("*", "/");
        return applyAi.animal(path);
    }
}
